<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template value_extractor</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Log v2">
<link rel="up" href="../../attributes.html#header.boost.log.attributes.value_extraction_fwd_hpp" title="Header &lt;boost/log/attributes/value_extraction_fwd.hpp&gt;">
<link rel="prev" href="result_of/extract_or_throw.html" title="Struct template extract_or_throw">
<link rel="next" href="visitation_result.html" title="Class visitation_result">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="result_of/extract_or_throw.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../attributes.html#header.boost.log.attributes.value_extraction_fwd_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="visitation_result.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.value_extractor"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template value_extractor</span></h2>
<p>boost::log::value_extractor — Generic attribute value extractor. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../attributes.html#header.boost.log.attributes.value_extraction_fwd_hpp" title="Header &lt;boost/log/attributes/value_extraction_fwd.hpp&gt;">boost/log/attributes/value_extraction_fwd.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> FallbackPolicyT<span class="special">,</span> <span class="keyword">typename</span> TagT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="value_extractor.html" title="Class template value_extractor">value_extractor</a> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">FallbackPolicyT</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="value_extractor.html#boost.log.value_extractorconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="value_extractor.html#idm26576-bb"><span class="identifier">value_extractor</span></a><span class="special">(</span><a class="link" href="value_extractor.html" title="Class template value_extractor">value_extractor</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="value_extractor.html#idm26583-bb"><span class="identifier">value_extractor</span></a><span class="special">(</span><span class="identifier">U</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="value_extractor.html#idm26508-bb">public member functions</a></span>
  <span class="identifier">result_type</span> <a class="link" href="value_extractor.html#idm26509-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><a class="link" href="attribute_value.html" title="Class attribute_value">attribute_value</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">result_type</span> <a class="link" href="value_extractor.html#idm26521-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="attribute_value_set.html" title="Class attribute_value_set">attribute_value_set</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">result_type</span> <a class="link" href="value_extractor.html#idm26538-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">record</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">result_type</span> <a class="link" href="value_extractor.html#idm26554-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">fallback_policy</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a class="link" href="value_extractor.html#idm26570-bb"><span class="identifier">get_fallback_policy</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm38886"></a><h2>Description</h2>
<p>Attribute value extractor is a functional object that attempts to find and extract the stored attribute value from the attribute values view or a log record. The extracted value is returned from the extractor. </p>
<div class="refsect2">
<a name="idm38889"></a><h3>
<a name="boost.log.value_extractorconstruct-copy-destruct"></a><code class="computeroutput">value_extractor</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm26576-bb"></a><span class="identifier">value_extractor</span><span class="special">(</span><a class="link" href="value_extractor.html" title="Class template value_extractor">value_extractor</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Default constructor</p>
<p>Copy constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">explicit</span> <a name="idm26583-bb"></a><span class="identifier">value_extractor</span><span class="special">(</span><span class="identifier">U</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">arg</code></span></p></td>
<td><p>Fallback policy constructor argument </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm38935"></a><h3>
<a name="idm26508-bb"></a><code class="computeroutput">value_extractor</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idm26509-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><a class="link" href="attribute_value.html" title="Class attribute_value">attribute_value</a> <span class="keyword">const</span> <span class="special">&amp;</span> attr<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Extraction operator. Attempts to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">attr</code></span></p></td>
<td><p>The attribute value to extract from. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted value, if extraction succeeded, an empty value otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idm26521-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> 
                       <a class="link" href="attribute_value_set.html" title="Class attribute_value_set">attribute_value_set</a> <span class="keyword">const</span> <span class="special">&amp;</span> attrs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">attrs</code></span></p></td>
<td><p>A set of attribute values in which to look for the specified attribute value. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Attribute value name. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted value, if extraction succeeded, an empty value otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idm26538-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">record</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Attribute value name. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">rec</code></span></p></td>
<td><p>A log record. The attribute value will be sought among those associated with the record. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted value, if extraction succeeded, an empty value otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idm26554-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><a class="link" href="attribute_name.html" title="Class attribute_name">attribute_name</a> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Attribute value name. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">rec</code></span></p></td>
<td><p>A log record view. The attribute value will be sought among those associated with the record. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted value, if extraction succeeded, an empty value otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">fallback_policy</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a name="idm26570-bb"></a><span class="identifier">get_fallback_policy</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Fallback policy </p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2007-2021 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="result_of/extract_or_throw.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../attributes.html#header.boost.log.attributes.value_extraction_fwd_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="visitation_result.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
